<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="author" content="ISUX">
    <meta name="layout" content="main_mobile">
    <meta name="format-detection" content="telephone=no"/>
    <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <meta name="apple-mobile-web-app-status-bar-style" content="black"/>

    <link rel="stylesheet" type="text/css" href="../frozen/css/frozen.css">
    <link rel="stylesheet" type="text/css" href="../css/default.css">

    <title>项目进展</title>
    <link rel="stylesheet" type="text/css" href="../css/user_center.css">
    <link rel="stylesheet" type="text/css" href="../venobox/venobox.css" media="screen" />
    <style type="text/css">
    
li .btn-more {
    text-align: center;
    color: #666;
    border: 1px solid #ddd;
    background-color: #fafafa;
    -webkit-border-radius: 5px;
    -moz-border-radius: 5px;
    border-radius: 5px;
    line-height: 38px;
}
.ui-btn-group {
    display: -webkit-box;
    width: 50%;
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    -webkit-box-align: center;
}
 .ui-btn-group button {
    height: 32px;
    line-height: 32px;
    color: #504b48;
    width: 44%;
    font-size: 16px;
}
    
    
    </style>
</head>
<body>
    <section class="ui-container">

        <%--<ul class="ui-tiled ui-info-tiled ui-border-tb">
            <li>
                <div class="num"><em>${donatesTotal}</em>个</div>
                <div>支持项目</div>
            </li>
            <li>
                <div class="num"><em><g:formatNumber number="${donatesTotalMoney}" format="0.00"/></em>元</div>
                <div>共捐善款</div>
            </li>
            <li>
                <div class="num"><em><g:formatNumber number="${fdonatesTotalMoney/100}" format="0.00"/></em>元</div>
                <div>获得配捐</div>
            </li>
        </ul>
        --%><div class="ui-card-module ui-border-tb">
            <h4 class="ui-border-b">动态信息（${projectfeedbackTotal}）</h4>

            <ul class="trend-list ui-border-b" id="dynamic">
            <%--
            <g:each in="${projectFeedBacks}" var="feedBack" status="i">	
             <g:link controller="project" action="projectDetail" params='[projectid:"${feedBack.project.id}"]'>
                <li class="ui-border-b">
                    <h3>${feedBack.project.name}<p><g:formatDate format="yyyy-MM-dd HH:mm" date="${feedBack.date}"/></p></h3>
                    <p>
                       	${feedBack.text}
                    </p>
                    <div class="img-list">
                    <g:if test="${feedBack?.img3 }">
           			<a class="venobox" data-gall="gall1" title="" href="/scfire/project/imgRead?img=${feedBack.img1}"><span class="size3" style="background-image:url(/scfire/project/imgRead?img=${feedBack.img1})"></span></a>
		              <a class="venobox" data-gall="gall1" title="" href="/scfire/project/imgRead?img=${feedBack.img2}"><span class="size3" style="background-image:url(/scfire/project/imgRead?img=${feedBack.img2})"></span></a>
		              <a class="venobox" data-gall="gall1" title="" href="/scfire/project/imgRead?img=${feedBack.img3}"><span class="size3" style="background-image:url(/scfire/project/imgRead?img=${feedBack.img3})"></span></a>
		              <g:if test="${feedBack?.img4}">
             		<a class="venobox" data-gall="gall1" title="" href="/scfire/project/imgRead?img=${feedBack.img4}"><span class="size3" style="background-image:url(/scfire/project/imgRead?img=${feedBack.img4})"></span></a>
	            	 </g:if>
	            	 <g:if test="${feedBack?.img5}">
	             		<a class="venobox" data-gall="gall1" title="" href="/scfire/project/imgRead?img=${feedBack.img5}"><span class="size3" style="background-image:url(/scfire/project/imgRead?img=${feedBack.img5})"></span></a>
	            	 </g:if>
	            	 <g:if test="${feedBack?.img6}">
	             		<a class="venobox" data-gall="gall1" title="" href="/scfire/project/imgRead?img=${feedBack.img6}"><span class="size3" style="background-image:url(/scfire/project/imgRead?img=${feedBack.img6})"></span></a>
	            	 </g:if>
	            	 <g:if test="${feedBack?.img7}">
	             		<a class="venobox" data-gall="gall1" title="" href="/scfire/project/imgRead?img=${feedBack.img7}"><span class="size3" style="background-image:url(/scfire/project/imgRead?img=${feedBack.img7})"></span></a>
	            	 </g:if>
	            	 <g:if test="${feedBack?.img8}">
	             		<a class="venobox" data-gall="gall1" title="" href="/scfire/project/imgRead?img=${feedBack.img8}"><span class="size3" style="background-image:url(/scfire/project/imgRead?img=${feedBack.img8})"></span></a>
	            	 </g:if>
	           		</g:if>
	           		<g:elseif test="${feedBack?.img2 }">
            		<a class="venobox" data-gall="gall1" title="" href="/scfire/project/imgRead?img=${feedBack.img1}"><span class="size2" style="background-image:url(/scfire/project/imgRead?img=${feedBack.img1})"></span></a>
	          				 <a class="venobox" data-gall="gall1" title="" href="/scfire/project/imgRead?img=${feedBack.img2}"><span class="size2" style="background-image:url(/scfire/project/imgRead?img=${feedBack.img2})"></span></a>
	           		</g:elseif>
	           		<g:elseif test="${feedBack?.img1 }">
	           			<a class="venobox" data-gall="gall1" title="" href="/scfire/project/imgRead?img=${feedBack.img1}"><img src="/scfire/project/imgRead?img=${feedBack.img1}" alt=""></a>
	           		</div>
	           		</g:elseif>
                     <g:if test="${user?.id == feedBack?.member?.id }">
                   		<a href = "##" onclick="deleteFeedBack('${feedBack.id}')">删除</a>
                   </g:if>
                </li>
                </g:link>
                </g:each>
            --%></ul>
            
        </div>
 <div class="ui-line-more" id="more">
             <p  id='week'>加载完成</p>
        </div>
        
    </section>

    <script src="../frozen/lib/zeptojs/zepto.min.js"></script>
    <script src="../frozen/js/frozen.js"></script>
    <script src="../js/jquery-1.10.2.js"></script>
    <script src="../venobox/venobox.min.js"></script>
    <script src="../js/jquery-migrate-1.2.1.min.js"></script>
    
    <script>
        var finalOffset=20
     	var offset = 0
     	ajaxRead();
        function ajaxRead(){  
             var html="";  
             $.ajax({
                  type:'get',  
                  dataType:'json',
                  url:'/scfire/user/userFeedBackDetail?format=json&offset='+ offset,  		           
                  beforeSend:function(){console.log('loading...');$("#week").html('加载中...');},  
                  success:function(data){
                    
                  $.each(data,function(i,item){
                     
                	  offset++
                    html+= "<li class='ui-border-tb'>"
                    html+= "<a href='/scfire/project/projectDetail?projectid="+item.projectid+"'>"
                    html+= "<h3>"
                    html+= "<p>"+item.date+"</p></h3>"
                    html+= "<p>"+item.text
                    html+= "</p>"
                    html+= "<div class='img-list'>"
                    if(item.img3!=null){
                     html+= "<a class='venobox' data-gall='gall1"+item.date+"' title='' href='/scfire/project/imgRead?img="+item.img1+"'><span class='size3' style='background-image:url(/scfire/project/imgRead?img="+item.img1+")'></span></a>"
                     html+= "<a class='venobox' data-gall='gall1"+item.date+"' title='' href='/scfire/project/imgRead?img="+item.img2+"'><span class='size3' style='background-image:url(/scfire/project/imgRead?img="+item.img2+")'></span></a>"
                     html+= "<a class='venobox' data-gall='gall1"+item.date+"' title='' href='/scfire/project/imgRead?img="+item.img3+"'><span class='size3' style='background-image:url(/scfire/project/imgRead?img="+item.img3+")'></span></a>"
                    
                     if(item.img4!=null){
                      html+= "<a class='venobox' data-gall='gall1"+item.date+"' title='' href='/scfire/project/imgRead?img="+item.img4+"'><span class='size3' style='background-image:url(/scfire/project/imgRead?img="+item.img4+")'></span></a>"
                     }	
                     if(item.img5!=null){
                      html+= "<a class='venobox' data-gall='gall1"+item.date+"' title='' href='/scfire/project/imgRead?img="+item.img5+"'><span class='size3' style='background-image:url(/scfire/project/imgRead?img="+item.img5+")'></span></a>"
                     }
                     if(item.img6!=null){
                      html+= "<a class='venobox' data-gall='gall1"+item.date+"' title='' href='/scfire/project/imgRead?img="+item.img6+"'><span class='size3' style='background-image:url(/scfire/project/imgRead?img="+item.img6+")'></span></a>"
                     }
                     if(item.img7!=null){
                      html+= "<a class='venobox' data-gall='gall1"+item.date+"' title='' href='/scfire/project/imgRead?img="+item.img7+"'><span class='size3' style='background-image:url(/scfire/project/imgRead?img="+item.img7+")'></span></a>"
                     }
                     if(item.img8!=null){
                      html+= "<a class='venobox' data-gall='gall1"+item.date+"' title='' href='/scfire/project/imgRead?img="+item.img8+"'><span class='size3' style='background-image:url(/scfire/project/imgRead?img="+item.img8+")'></span></a>"
                     }
                   }else if(item.img2!=null){
                     html+= "<a class='venobox' data-gall='gall1"+item.date+"' title='' href='/scfire/project/imgRead?img="+item.img1+"'><span class='size3' style='background-image:url(/scfire/project/imgRead?img="+item.img1+")'></span></a>"
      	           html+= "<a class='venobox' data-gall='gall1"+item.date+"' title='' href='/scfire/project/imgRead?img="+item.img2+"'><span class='size3' style='background-image:url(/scfire/project/imgRead?img="+item.img2+")'></span></a>"
                   }else if(item.img1!=null){
                     html+= "<a class='venobox' data-gall='gall1"+item.date+"' title='' href='/scfire/project/imgRead?img="+item.img1+"'><img src='/scfire/project/imgRead?img="+item.img1+"' alt=''></a>"
                   }
                   html+= "</div>"
                   html+= "</a>"
                   if(item.memberid==${user?.id}){
                	   html+="<div class='ui-btn-group'>"
                		   html+="<button class='ui-btn-lg' onclick='deleteFeedBack(\""+item.id+"\")'>删除</button>"
                		   html+="</div>"
                     
                   }
                   html+= "</li>"	
      		   });
                 $("#dynamic").append($(html));
                 if(data.length<finalOffset){    
                     				
        				$("#week").html("已经到底了")
        				$("#week").removeAttr("onclick");
        				
            		}else{
       	            $("#week").html("加载更多")
       	            $("#week").attr("onclick","ajaxRead()");
                		}
                 (function() {
                 	
                     $('.venobox').venobox({
                         numeratio: true,
                         border: '20px'
                     });
                     $('.venoboxvid').venobox({
                         bgcolor: '#000'
                     });
                     $('.venoboxframe').venobox({
                         border: '6px'
                     });
                     $('.venoboxinline').venobox({
                         framewidth: '300px',
                         frameheight: '250px',
                         border: '6px',
                         bgcolor: '#f46f00'
                     });
                     $('.venoboxajax').venobox({
                         border: '30px;',
                         frameheight: '220px'
                     });
                 })();

          		
                },  
             complete:function(){console.log('mission complete.')} ,
             error:function(data){
               $("#week").html('已经到底了');
               alert("");
               $("#week").removeAttr("onclick");
               }
          });
         }  


        function deleteFeedBack(id){
    		if(window.confirm('确认要删除该反馈进展吗？')){
    			var url = "/scfire/user/deleteProjectFeedBack";
    			$.ajax({
    	            type: "post",
    	            url: url,
    	            async :　false,
    	            data: {id : id},
    	            dataType: "json",
    	            success: function(data){
    	                alert(data.info);
    	                window.location.href = "/scfire/user/userFeedBackDetail";
    	            },
    	            error : function (data){
    					alert(data);
    	            }
    			});
                return true;
             }else{
                //alert("取消");
                return false;
            }
    		
    	}

    </script>
</body>
</html>